<!DOCTYPE html>
<html>
<head>
    <title>找攻略</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategy.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog/dialog.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/dialog/dialog.min.js"></script>
    <script src="/js/plugins/jrender/jrender.js"></script>
	<script>
        //创建一个选项卡的方法
        function createTab(index, obj) {
            /*<li class="nav-item" data-index="xx">
            <a data-tid="xx" class="nav-link" data-toggle="pill" href="#pills-xx">oo</a>
                    </li>*/
            var a = $("<a class='nav-link' data-toggle='pill'></a>").attr("data-tid", obj.id)
                .attr("href", "#pills-"+obj.id).html(obj.name);
            return $("<li class='nav-item'></li>").attr("data-index", index).append(a);
        }

        $(function () {

            //1.游记
            $.get("/travels/commends",{type:3},function (data) {
                console.log(data);
                $(".commend").renderValues(data[0],{
                    handle:function (ele,value) {
                        ele.href="travelContent.html?id="+value;
                    }
                });
            })

            //2.大攻略
            $.get("/strategies/commend",{state:2},function (data) {
                console.log(data);
                $(".strategyCommend").renderValues({list:data},{
                    handle:function (ele,value) {
                        ele.href="strategyCatalogs.html?id="+value;
                    }
                });
            })

            //3.热点区域
            $.get("/regions/hots",{state:1},function (data) {
                console.log(data);
                $.each(data,function (index, ele) {
                    var place=createTab(index,ele);
                    $(place).appendTo($("#pills-tab"));
                })
            })


        });
    </script>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class="form-control searchBtn" placeholder="找攻略">
            </div>
        </div>
    </div>
</div>

<ul class="nav nav-pills nav-justified border border-left-0 border-top-0 border-right-0" id="pills-tab" role="tablist">
    <li class="nav-item">
        <a class="nav-link active show" data-toggle="pill" href="#pills-top">
            <span style="font-weight: bold;">推荐</span>
        </a>
    </li>

    <!--<li class="nav-item" data-index="0">
        <a class="nav-link" data-toggle="pill" href="#pills-1">亚洲</a>
    </li>
    <li class="nav-item" data-index="1">
        <a class="nav-link" data-toggle="pill" href="#pills-2">欧洲</a>
    </li>
    <li class="nav-item" data-index="2">
        <a class="nav-link" data-toggle="pill" href="#pills-3">北美洲</a>
    </li>-->

</ul>

<div class="tab-content" id="pills-tabContent">
    <div class="tab-pane fade active show" id="pills-top">

        <div class="container commend">
            <a render-key="travel_id" render-fun="handle">
                <img render-src="coverUrl">
                <p render-html="title"></p>
            </a>
        </div>

        <hr>
        <div class="container strategyCommend">
            <h6>推荐</h6>
            <div class="row hot" render-loop="list">

                <div class="col-4">
                    <a render-key="list.id" render-fun="handle">
                        <img render-src="list.coverUrl">
                        <p render-html="list.title"></p>
                    </a>
                </div>

            </div>
        </div>
    </div>
    <div class="tab-pane fade" id="pills-1">
        <div class="container">
            <h6>当季推荐</h6>
            <div class="row hot">
                <div class="col ">
                    <a href="/strategyCatalogs.html?id=1">
                        <img src="/upload/30841451-5fd7-49b8-bcdb-54bccf0bb505.jpeg">
                        <p>0次浏览</p>
                    </a>
                </div>
                <div class="col ">
                    <a href="/strategyCatalogs.html?id=2">
                        <img src="/upload/e5e8a1a7-b127-4145-9fd0-a94e29f752ba.jpeg">
                        <p>0次浏览</p>
                    </a>
                </div>
                <div class="col ">
                    <a href="/strategyCatalogs.html?id=3">
                        <img src="/upload/7c91a3bc-b235-49c3-935a-67e5b1952eba.jpeg">
                        <p>0次浏览</p>
                    </a>
                </div>
            </div>
        </div>
        <hr>
        <div class="container">
            <h6>全部攻略</h6>
            <div class="row classify ">
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=1">
                        <img class="float-left " src="/upload/30841451-5fd7-49b8-bcdb-54bccf0bb505.jpeg">
                        <div class="classify-text">
                            <span>成都</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=2">
                        <img class="float-left " src="/upload/e5e8a1a7-b127-4145-9fd0-a94e29f752ba.jpeg">
                        <div class="classify-text">
                            <span>广州</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=3">
                        <img class="float-left " src="/upload/7c91a3bc-b235-49c3-935a-67e5b1952eba.jpeg">
                        <div class="classify-text">
                            <span>北京</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=4">
                        <img class="float-left " src="/upload/e170dc16-c976-4eae-8513-d01d144bed2b.jpeg">
                        <div class="classify-text">
                            <span>上海</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="tab-pane fade" id="pills-2">
        <div class="container">
            <h6>当季推荐</h6>
            <div class="row hot">
                <div class="col ">
                    <a href="/strategyCatalogs.html?id=5">
                        <img src="/upload/530bb06c-47b9-4371-9699-705d78f17bd6.jpeg">
                        <p>0次浏览</p>
                    </a>
                </div>
                <div class="col ">
                    <a href="/strategyCatalogs.html?id=6">
                        <img src="/upload/c9eb542e-fcf8-4bff-8a73-d7a2f241b402.jpeg">
                        <p>0次浏览</p>
                    </a>
                </div>
            </div>
        </div>
        <hr>
        <div class="container">
            <h6>全部攻略</h6>
            <div class="row classify ">
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=5">
                        <img class="float-left " src="/upload/530bb06c-47b9-4371-9699-705d78f17bd6.jpeg">
                        <div class="classify-text">
                            <span>巴黎</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
                <div class="col-6 mb">
                    <a href="/strategyCatalogs.html?id=6">
                        <img class="float-left " src="/upload/c9eb542e-fcf8-4bff-8a73-d7a2f241b402.jpeg">
                        <div class="classify-text">
                            <span>伦敦</span>
                            <p>0人收藏</p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="tab-pane fade" id="pills-3">
        <div class="container">
            <h6>当季推荐</h6>
            <div class="row hot">
            </div>
        </div>
        <hr>
        <div class="container">
            <h6>全部攻略</h6>
            <div class="row classify ">
            </div>
        </div>
    </div>
</div>
</body>
</html>